todetail = function(shipid) {
        //ColdFusion.navigate('shipmentdetail.cfm?action=detail&id=' + shipid,'content');
		document.getElementById("id").value = shipid;
        ColdFusion.objectCache['tblRev'].selectedRow=-1;
}

				


function deleteItem(btn){
	if(btn == 'yes')
	{
		ColdFusion.navigate('deleteRevista.cfm?&id=' + document.getElementById("id").value,'detailDelete');
	}
}

var gridRender = function()
{
	//over
	grid = ColdFusion.Grid.getGridObject('tblRev');
	var bbar = Ext.DomHelper.overwrite(grid.bbar,{tag:'div',id:Ext.id()},true);
	 
	var cmbstate = new Ext.form.ComboBox({
	   id:"cmbstate",
	   emptyText:"State",
	   mode:"local",
	   width:65,
	   triggerAction:"all",
	   displayField:"text",
	   valueField:"value",
	   store:new Ext.data.SimpleStore({fields: ["value","text"],data:[['car','car'],['cas','cas'],['FL','FL']]})
	});
 
	//Insert blank div on top of the grid.
	var tbar=Ext.DomHelper.insertFirst(grid.el,{tag:'div',id:Ext.id()},true);
	//Convert inserted div to Ext toolbar
	var gtbar = new Ext.Toolbar({
			renderTo: tbar,
			items: [/*cmbstate,*/'-',
			{/*
			 text:"Reload",
			   cls:"x-btn-text",
			   tooltip:"Reload",
			   handler: function(){ColdFusion.Grid.refresh('tblRev');}
			  },
			  {*/
			 text:"Agregar",
			   cls:"x-btn-text",
			   tooltip:"Agregar",
			   icon:"../images/botones/add.png",
			   handler: function(){ window.location.href="formRevista.cfm"; }
			  },
			  {
			 text:"Borrar",
			   cls:"x-btn-text",
			   tooltip:"Borrar",
			   icon:"../images/botones/delete.png",
			   handler: function(){doDel()},
			   success: function(){ ColdFusion.Grid.refresh('tblRev');  }
			  },
			  {text:"Editar",
			   cls:"x-btn-text",
			   tooltip:"Editar",
			   icon:"../images/botones/edit.png",
			   handler: function(){ document.getElementById("frmRevista").submit(); }
			  },
			]
			
			
	});
			 
	gbbar = new Ext.PagingToolbar({
	renderTo:bbar,
	store: grid.store,
	pageSize: 5,
	displayInfo: true,
	displayMsg: '<b>Filas {0} - {1} de {2}</b>',
	emptyMsg: "<b>No Record</b>"
	});
};  